package com.euond.accv.mdm.api.controller;

import com.euond.accv.mdm.client.dto.MdmStoreDTO;
import com.euond.accv.mdm.domain.MdmStore;
import com.euond.accv.mdm.service.MdmStoreService;
import com.euond.common.api.controller.BaseReadApiController;
import com.euond.common.web.controller.annotation.FeignRestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by liqi on 2017/3/16.
 */
@FeignRestController
@RequestMapping("/feign_api/mdm_store")
@Api(description = "门店资料Api")
public class MdmStoreApiController extends BaseReadApiController<MdmStore,String> {

    @Autowired
    MdmStoreService service;

    @Override
    protected void init() {
        setBaseService(service);
        setMainVOClazz(MdmStoreDTO.class);
    }

    @ApiOperation(value = "根据门店编号查询门店", httpMethod="GET")
    @GetMapping("/findStoreByNo")
    public List<MdmStoreDTO> findStoreByNo(@RequestParam("storeNo") String storeNo){
        List<MdmStoreDTO> dtoList = service.findStoreByNo(storeNo);

        return dtoList;
    }
}
